package top.goldenyear.porpoise.infra.job.listener;

import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.event.AppLoadEndEvent;
import org.noear.solon.core.event.EventListener;
import top.goldenyear.porpoise.infra.job.service.JobService;

/**
 * 系统附加初始化工作
 *
 * @author airhead
 */
@Component
@Slf4j
public class JobAppLoadEndEventListener implements EventListener<AppLoadEndEvent> {
  @Inject private JobService jobService;

  @Override
  public void onEvent(AppLoadEndEvent appLoadEndEvent) throws Throwable {
    jobService.startAll();
  }
}
